require('Particles')
require('Shaders')

Parasite = {}
Parasite.__index = Parasite

function Parasite.load(x,y)
	
	local parasite = {}
	setmetatable(parasite, Parasite)
	parasite.x = x
	parasite.y = y
	parasite.pixelEffect = love.graphics.newPixelEffect((Shaders.getNoEffect()):format(#parasite))
	
	parasite.particleSys = Particles.getParasiteParticleSys(0,0)
	parasite.particleSys:start()
	
	parasite.diePartSys = Particles.dieParasiteParticleSys(0,0)
	return parasite
	
end

function Parasite:update(dt)

	self.particleSys:update(dt)
	self.diePartSys:update(dt)
end

function Parasite:draw()

	love.graphics.setColorMode("modulate")
	love.graphics.setBlendMode("additive")
	love.graphics.draw(self.particleSys, self.x, self.y)
	love.graphics.draw(self.diePartSys, self.x, self.y)		
end

function Parasite:die()
	--self.diePartSys:start()
end